% construct the wage distribution (Log Normal)
function res = alphadist_LN(x,pr)

mu        = x(1);  % normal mean
sig       = x(2);  % normal sd
w         = exp(linspace(log(pr.wmin),log(pr.wmax),pr.na)'); % grid for exp(alpha), linearly spaced in log
pdf       = 1./((2.*pi).^(1/2).*sig).*exp(-(log(w)-mu).^2./(2.*sig.^2));  % Gaussian density
pai       = pdf./sum(pdf); % probablity measure

res       = [ sum(w.*pai)-1 ; sum((log(w)-sum(log(w).*pai)).^2.*pai)-pr.va ];

disp([x;res'])
save w w
save pai pai
save pdf pdf